//
//  XTDemoViewController.swift
//  MyBlog
//
//  Created by victor on 16/11/11.
//  Copyright © 2016年 victor. All rights reserved.
//

import UIKit

class XTDemoViewController: XTBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // ?? 可以解决 会出现optional的问题
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个"
    }

    @objc fileprivate func showNext() {
        let vc = XTDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension XTDemoViewController {
    
    override func setupTableView() {
        super.setupTableView()
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", fontSize: 16, target: self, action: #selector(showNext))
    }
}
